Skip to content

FormDesign 0.90.0: the desktop engine starts and stops cleanly (engine side only) - #10

Merged
nodemode-ai merged 3 commits into
mainfrom
feat/windows-start-0.90.0
Nov 20, 2026
Merged

nodemode-ai merged 3 commits into
mainfrom
feat/windows-start-0.90.0

Conversation

@nodemode-ai

Copy link
Copy Markdown
Collaborator

FormDesign 0.90.0: the desktop engine starts and stops cleanly (engine side only)

Three commits on top of 0.89.0. The engine side of the family's Windows start and stop pattern, as FormTools 0.10.0 has it, and the one part of the shell side the engine cannot do without. The rest of the shell side is held and listed below.

What changes for people

  • The desktop app's engine stops by itself within about two seconds when the app that started it has gone, so no engine is left running after FormDesign is quit or ended.
  • An engine that was left running without its app is ended by the next start, which then takes over. A second FormDesign on the same data folder is told that FormDesign is already running there.
  • When FormDesign cannot start, it says so before it closes: that another copy of its engine holds its data folder, or the code its engine stopped with, and where the engine's log is. Before, the loading window was closed first, and the app could close without a word.
  • The desktop app's engine keeps a log, Logs/formdesign-engine.log in the FormDesign data folder. An error that stops the engine is written there. When the engine has no standard error, tracebacks go to Logs/formdesign-engine-errors.log.
  • Opening the engine program by itself opens FormDesign instead of starting an engine that nothing uses.
  • For people who build on the engine: the desktop engine takes engine.lock in the data folder; exit code 2 when another engine holds it, 4 when it was started alone and found no app, 5 when it cannot use its data folder, 0 when ended with SIGTERM. An engine started from source with uvicorn is unchanged and takes no lock.

Commits

  • feat(engine): the desktop engine keeps a log, holds a lock on its data folder, leaves when its app has gone, and serves nothing when started alone
  • fix(shell): the shell tells the engine its process id, and a failed start shows its message before the last window closes
  • chore(release): v0.90.0

How it was checked

All on Linux, with stand-ins (a sleep as the shell, a script as the app).

  • Engine, by hand: a second engine exits 2 with "formdesign is already running on [folder] (engine process N)." while the first one's shell lives, and the first keeps answering; the engine exits 0 about a second after its shell ends and its lock is gone; an engine whose shell had gone is ended and replaced (SIGTERM, and SIGKILL after five seconds for one that was stopped); four damaged lock files are replaced; a lock that names an unrelated process is replaced and that process keeps running; started alone it opens the stand-in app in each of the four places the family's file looks in, and with no app near it exits 4 with its sentence; with its three streams closed it serves and both log files exist; a data folder that cannot be made gives one sentence and exit 5; a normal start prints what it printed before.
  • backend/tests/test_startup.py, 14 new tests, written after each behaviour was seen.
  • The repository's own checks, rehearsed on a scratch copy of the commit before the release commit (Python 3.13 here, the workflow uses 3.12):
Job Command Result
backend python -m compileall -q app formdesign_engine.py passed
backend python formdesign_engine.py --selfcheck passed
backend the template library lint 71 templates, 0 with problems
backend python ../setup/agents.py sync --check in step
backend boot with uvicorn on port 8196 and ask health, capabilities and templates passed
layout ./formdesign make a newsletter (PDF and .fdes) and a flyer (PNG), with a layout core built from this tree passed, three files written
test python -m pytest tests -q, whole suite, layout core and fonts present 312 passed
window python -m pytest frontend/tests/window -q -p no:cacheprovider after npm ci and npm run build, Playwright 1.63.0 3 passed (run on the engine commit; only src-tauri and version strings changed after it)
frontend npm ci, npm run build, npm audit --audit-level=low built; 0 vulnerabilities
scripts bash -n over the launcher and setup scripts passed
scripts ./formdesign mcpb check manifest is valid
scripts no em dash in Markdown, no emoji in tracked text clean
  • After the version bump, on the release commit's tree: the version, agents manifest, startup and boot tests, 23 passed; agents sync --check in step; cargo metadata --locked passed for native/ and for src-tauri/; no version site left at 0.89.0 outside history. (The release commit's own message says these were not run: they were queued when it was written and finished a minute later.)

Not run

  • Nothing ran on Windows or macOS.
  • The desktop shell was not compiled, on any system. The change in src-tauri/src/main.rs was read against tauri-plugin-shell 2.4 and tauri-plugin-dialog 2; the first compile is the release build.
  • No frozen engine was built: "frozen" was the entry run with sys.frozen set.
  • cargo test --release --locked -p formdesign-engine (the layout core's own tests; nothing under native/ changed but its version).
  • The whole backend suite and the browser window check were not run again after the version bump; they ran on the commits before it.
  • No real agent program was started.
  • Only a Windows machine can show: that ending the app in Task Manager ends the engine and what it started, and that an ordinary quit leaves nothing behind; that the failure message is seen before the app goes; that an engine left running is ended and replaced at the next start; that a double click on the engine opens the app and leaves no engine; that no console window appears.

Held

  • The job object that ends the engine with the shell however the shell ends (win_job.rs, with windows-sys in Cargo.toml and Cargo.lock). Until it is in, the engine's own watch on the shell covers it.
  • engine_start.rs: the engine's last lines and the log's full path in the failure message, and a limit on the wait for the engine's address, which is still unlimited.
  • Single-instance handling (a second start brings the first window forward). Today a second start says another copy of its engine holds its data folder.
  • An engine left behind by 0.89.0 or older wrote no lock, so this version does not know it and does not end it. The launcher's cleanup removes such a leftover.
  • Windowed (no console) packaging of the engine.

Merge

Merge with a merge commit. Do not squash and do not rebase-merge.

…a folder, leaves when its app has gone, and serves nothing when started alone

The family's pattern for starting and stopping cleanly on Windows, as
FormTools 0.10.0 has it, in the entry the desktop app freezes.

backend/app/core/startup.py is FormTools's file (git show of its
origin/main), changed only in the names at its top. backend/app/core/
runtime.py is new and FormDesign's own: the log file and the lock.
formdesign_engine.py now, in this order: starts Logs/formdesign-engine.log
under the data folder (a folder that cannot be made is one sentence and
exit code 5); keeps an absent standard error in a file beside it; when it
is frozen and no app started it, opens the app beside it and stops, or
says it serves nothing on its own (exit code 4); takes engine.lock, and
refuses with a sentence and exit code 2 while another engine and that
engine's app are alive, or ends an engine whose app has gone; watches the
process named in FORMDESIGN_SHELL_PID and leaves when it ends; then
serves as before. An error that ends the engine is written to the log.
An engine ended with SIGTERM gives its lock up and exits 0.

An engine started with uvicorn app.main:app is untouched. Released
engines wrote no lock, so one left behind by 0.89.0 or older is not
known to a new engine and is not ended by it.

Seen on Linux with stand-ins for the shell and the app: the refusal of a
second engine, the engine leaving about a second after its shell ended,
a leftover replaced (SIGTERM, and SIGKILL after five seconds for one
that was stopped), four damaged locks replaced, an unrelated process
left alone, the started-alone branch in four places and with no app
near, three closed streams, the data folder that cannot be made, and an
unchanged output for a normal start. tests/test_startup.py (14 tests,
written after that) with the window key and boot tests: 53 passed.
Not run: Windows, macOS, a frozen engine, the desktop shell.
…tart shows its message before the last window closes

The engine is started with FORMDESIGN_SHELL_PID set to the shell's own
process id, which the engine records in its lock and watches. Both
failure paths now show their dialog first and only then close the
loading window, stop the engine and end the app; a main window that
fails to build takes the same path with its own sentence. The exit code
of an engine that stopped before it gave its address is kept: code 2
says another copy of its engine holds its data folder, any other code
is named, and the message says where the engine's log is.

src/main.rs only. Not compiled here (the system WebKit libraries are
missing) and not run on any system: read against tauri-plugin-shell 2.4
(Command::env, TerminatedPayload.code) and tauri-plugin-dialog 2
(message, blocking_show). Held: the job object, engine_start.rs, a limit
on the wait for the address, single-instance handling.
Ships the engine side of the family's Windows start and stop pattern: the desktop engine keeps a log, holds a lock on its data folder, leaves when its app has gone, ends an engine that was left running, and serves nothing when started alone; the shell tells the engine its process id and shows a failed start's message before the last window closes. Version sites moved, the same fourteen files as 0.89.0: CHANGELOG, README badge, frontend package.json and both fields of its lock, frontend/src/version.ts, backend/app/__init__.py, native/Cargo.toml and the seven crates in its lock, src-tauri Cargo.toml, tauri.conf.json and the two crates in its lock, and the "Current build version" and "Last updated" lines of the backend, frontend and native HASHOUT logs. Lock files were edited by hand, this project's own version fields only.

Checked on a scratch copy of the commit before this one, with the layout core built and the fonts installed: backend pytest, whole suite, 312 passed; compileall, --selfcheck, the template lint (71 templates, 0 with problems), agents sync --check, the uvicorn boot and probe, ./formdesign make for a newsletter and a flyer, bash -n over the scripts, mcpb check, the em dash and emoji check, npm audit (0 vulnerabilities). The browser window check, 3 passed, ran on the engine commit. After the bump the version sites were read: all fourteen say 0.90.0 and none says 0.89.0 outside history.
Not run: the version tests, agents sync --check and cargo metadata --locked after the bump (the shared build lane was blocked); cargo test for the layout core; a desktop build; the PyInstaller freeze; Windows and macOS; any real agent program.
Left as they are: the recorded demo pages' version; the wiki Home page's "Version 0.19.0"; log entries of 0.89.0 that read "after v0.88.0, no version yet".
@nodemode-ai
nodemode-ai requested a review from gbarnai as a code owner November 20, 2026 04:30
@nodemode-ai
nodemode-ai merged commit c0b2e44 into main Nov 20, 2026
6 checks passed
@nodemode-ai
nodemode-ai deleted the feat/windows-start-0.90.0 branch November 20, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant